package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 批量添加套餐内菜品
     * @param setmealDishList
     */
    void insertBatch(List<SetmealDish> setmealDishList);


    /**
     * 根据套餐id批量删除套餐内菜品
     * @param ids
     */
    void deleteBatch(List<Long> ids);


    /**
     * 根据id查询套餐相关所有菜品
     * @param id
     * @return
     */
    @Select("select * from sky_take_out.setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectById(Long id);


    /**
     * 根据id删除套餐内菜品
     * @param setmealId
     */
    @Delete("delete from sky_take_out.setmeal_dish where setmeal_id = #{setmealId}")
    void deleteById(Long setmealId);
}
